#include "stdio.h"
#include "stdlib.h"

typedef struct listNode {
    int data;
    struct listNode *next;
} node;

void input(node *head,int l){
    node *t;
    int a;
    for (int i = 0; i < l; ++i) {
        scanf("%d",&a);
        t = (node*) malloc(sizeof (node));
        t->data = a;
        t->next = head->next;
        head->next = t;
    }
}
int numpy (node* head,int l){
    int sum = 1;
    for (int i = 0; i < l; ++i) {
        sum *= head->next->data;
        head = head->next;
    }
    return sum;
}

int main(){
    node *s = (node*) malloc(sizeof (node));
    s->next = NULL;
    int n,m,sum = 0;
    scanf("%d%d",&n,&m);
    input(s,n);
    sum = numpy(s,m);
    printf("%d",m==0?0:sum);
}